//
//  YZAutoItemCell.m
//  VET
//
//  Created by Lam BG on 2018/7/14.
//  Copyright © 2018年 YZ. All rights reserved.
//

#import "YZAutoItemCell.h"

#import "YZAutoRowModel.h"

// auto cell id enum
#import "YZAutoFormHeader.h"

#import "YZRouter.h"
#import "YZJsonFileLoader.h"

// 第三方
#import "TBCityIconFont.h"

// categoru
#import "UIImage+Category.h"
#import "YZRouter+AutoVC.h"

@interface YZAutoItemCell ()

@property (weak, nonatomic) IBOutlet UILabel *itemTitle;

@property (weak, nonatomic) IBOutlet UIButton *selectBtn;

@property (weak, nonatomic) IBOutlet UIImageView *selectImg;

@end

#pragma mark -

@implementation YZAutoItemCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.selectImg.image = [UIImage iconWithInfo:TBCityIconInfoMake(@"\ue643", 8, kColorWithHex(0x007AFF))];
    [self.selectBtn setBackgroundImage:[UIImage imageWithColor:kColorWithHex(0x2FC66A)] forState:UIControlStateHighlighted];
}

#pragma mark -

- (void)setupCellView {
    [super setupCellView];
    
    self.itemTitle.text   = self.rowModel.displayValue;
    self.selectImg.hidden = !self.rowModel.isSelect;
}

#pragma mark - event action

- (IBAction)selectClicked:(id)sender {
    
    // 回调
    if (self.selectItemBlock) {
        
        self.selectItemBlock(self.rowModel.indexPath);
    }
}

@end





